import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

public class Main {
   public static void main(String[] args) {

      // 创建线程数量固定为2的线程池
      ExecutorService pool1 = Executors.newFixedThreadPool(2);

      // 创建只有一个线程的线程池
      ExecutorService pool2 = Executors.newSingleThreadExecutor();

      // 创建弹性线程池，线程数量会随着任务量的增加而增加
      ExecutorService pool3 = Executors.newCachedThreadPool();

      // 创建固定线程数量为3的线程池，同时可以对任务进行延迟运行操作
      ScheduledExecutorService pool4 = Executors.newScheduledThreadPool(3);
   }
}